package com.net.xpay.operator.secutiry;

import com.net.xpay.common.enums.user.ClientFrom;
import com.net.xpay.common.enums.user.LoginMethod;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.authentication.AbstractAuthenticationToken;

import java.time.LocalDateTime;

/**
 * @author  on 01/02/2018.
 */
@Getter
@Setter
public class FormLoginToken extends AbstractAuthenticationToken {
    private String mobile;

    private LoginMethod loginMethod; //登陆方式

    private String password;

    private String checkCode;

    private String codeKey;

    private String imageCode;

    private ClientFrom clientFrom;

    private Boolean rememberMe; //记住我的功能

    private String captcha; //螺丝帽人工智能验证码

    //以上是必填字段,下面是系统补充字段
    private LocalDateTime time;

    private String ip;

    public FormLoginToken() {
        super(null);
    }

    @Override
    public Object getCredentials() {
        return password;
    }

    @Override
    public Object getPrincipal() {
        return mobile;
    }
}

